<?php
/**
 * Post.php 
 *
 */
?>

<div id="post-<?php the_ID(); ?>" class="project tier <?php semantic_entries(); ?>">
	<div class="xMain column">
		<div class="content-pane">
			
			<?php				
				$projectAuthor = get_post_meta($post->ID, "author", false);
				$projectAuthorURL = get_post_meta($post->ID, "author-url", false);
			?>
			
			<?php if(!is_single()) { ?><a href="<?php the_permalink(); ?>"><?php } ?>
				<img class="thumb" src="<?php echo retrieve_thumbnail(); ?>" alt="<?php the_title(); ?>"/>
			<?php if(!is_single()) { ?></a><?php } ?>

			<h2>
				<?php if(!is_single()) { ?><a href="<?php the_permalink(); ?>" rel="bookmark"><?php } ?>
					<?php the_title(); ?>
				<?php if(!is_single()) { ?></a><?php } ?>
			</h2>
			
			<h3>
				<?php
				 	$counter = 0;
					$nAuthors = count($projectAuthor);
				
					foreach($projectAuthor as $key => $value) {
				
						if($projectAuthorURL[$key]) {
							echo "<a target='_blank' href='".$projectAuthorURL[$key]."'>";
						}
						echo $value;
						if($projectAuthorURL[$key]) {
							echo "</a>";
						}
						
						if($counter < $nAuthors-1) {
							echo ", ";
						}
						$counter++;
					} 
				?>	
			</h3>
			
			<?php 
				if(is_single()) {
					the_content();
			?>		
					<div class="sharing graphic">
						<h4>Share this project</h4>
						<?php include(TEMPLATEPATH . '/sharing.php'); ?>
					</div>
			<?php		
				} else {
					global $more;
					$more = 0;
					the_content(); //using a filter to customize the read more link, see wp-utils/filters.php -lev
					$more = 1;
				} 
			?>
		</div>
	</div>
	<div class="meta column">
		<h4>Tags</h4>
		<?php the_tags('<ul class="rotatedColors"><li>','</li><li>','</li></ul>'); ?>
	</div>	
</div>